package com.zoro.interviewee.lambda;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Collectors;

/**
 * @author zhaoxingwu
 */
public class RunTest {

    public static void main(String[] args) {
        OneClass oc = new OneClass();
        ParamClass pc = new ParamClass();

        // 实例方法引用
        String s = oc.oneMethod(pc::param,"a");
        // 静态方法引用
        String ss = oc.oneMethod(ParamClass::staticMethod,"a");
        // 构造方法引用

        Arrays.asList("a","b").stream().collect(Collectors.toCollection(()-> {
            return new ArrayList<>();
        }));

    }

}

class ParamClass{

    public String param() {
        return "param";
    }

    public static String staticMethod() {
        return "static";
    }
}
